#ifndef __SETTINGS_H_
#define __SETTINGS_H_

#include "../../API/Common/Typedefs.h"

#include <vector>
#include <string>
#include <libconfig.hh>

using namespace libconfig;

namespace skelepp {
	namespace Core {
		namespace Application {
			class Settings {
			private:
				Config _config;
				
				uint32_t _application_debug_level;
				string _application_log_file;
				uint32_t _application_worker_threads;

				string _network_role;
				uint32_t _network_port;
				string _network_protection;
				vector<string> _network_rules;

				uint32_t _master_max_slaves;

				string _slave_master_server;

				void _load(void);
			public:
				Settings(void);
				~Settings(void);
				
				string read_string(const char *path);
				int32_t read_int(const char *path);
				uint32_t read_uint(const char *path);
				float read_float(const char *path);
				vector<string> read_string_list(const char *path);

				// application
				uint32_t get__application_debug_level(void) {
					return _application_debug_level;
				}
				string get_application_log_file(void) {
					return _application_log_file;
				}
				uint32_t get_application_worker_threads(void) {
					return _application_worker_threads;
				}

				// network
				string get_network_role(void) {
					return _network_role;
				}
				uint32_t get_network_port(void) {
					return _network_port;
				}
				string get_network_protection(void) {
					return _network_protection;
				}
				vector<string> get_network_rules(void) {
					return _network_rules;
				}

				// master
				uint32_t get_master_max_slaves(void) {
					return _master_max_slaves;
				}

				// slave
				string get_slave_master_server(void) {
					return _slave_master_server;
				}
			};
		}
	}
}

#endif